<%@ page import="com.edu.imau.ManageUserInformation.User" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.edu.imau.ParkingDao" %><%--
  Created by IntelliJ IDEA.
  User: 贾维斯
  Date: 2022/12/15
  Time: 19:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>用户信息管理界面</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
    <!-- Bootstrap core CSS -->
    <link href="bootstrap-3.4.1/css/bootstrap.min.css" rel="stylesheet">
    <!-- Custom styles for this template -->
    <link href="navbar-fixed-top/navbar-fixed-top.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs/dt-1.13.1/datatables.min.css"/>
</head>
<body>
<form class="form-inline" action="add">
    <%--        <input type="hidden" name="id" value="<%= studentupdatae != null?studentupdatae.getId():""%>">--%>
    <input type="hidden" name="id" value="${user.id}">
<%--        <div class="form-group">--%>
<%--            <label class="sr-only" style="width: 120px">序号</label>--%>
<%--            <input type="text" class="form-control" name="id" id="id" placeholder="序号" style="width: 200px"value="${user.id}">--%>
<%--        </div>--%>
    <div class="form-group">
        <label class="sr-only" style="width: 120px">记录编号</label>
        <input type="text" class="form-control" name="code" id="code" placeholder="编号" style="width: 250px"value="${user.code}">
    </div>
    <div class="form-group">
        <label class="sr-only" style="width: 120px">IC卡号</label>
        <input type="text" class="form-control" name="number" id="number" placeholder="IC卡号" style="width: 250px" value="${user.number}">
    </div><div class="form-group">
    <label class="sr-only" style="width: 50px" >车主姓名</label>
    <input type="text" class="form-control" name="name" id="name" placeholder="车主姓名" style="width: 250px"value="${user.name}">
</div><div class="form-group">
    <label class="sr-only" style="width: 120px">车牌号码</label>
    <input type="text" class="form-control" name="carcode" id="carcode" placeholder="车牌号码" style="width: 250px"value="${user.carcode}">
</div><div class="form-group">
    <label class="sr-only" style="width: 120px">入场日期</label>
    <input type="text" class="form-control" name="indate" id="indate" placeholder="入场日期" style="width: 250px"value="${user.indate}">
</div><div class="form-group">
    <label class="sr-only" style="width: 120px">出场日期</label>
    <input type="text" class="form-control" name="outdate" id="outdate" placeholder="出场日期" style="width: 250px"value="${user.outdate}">
</div>
    <button type="submit" class="btn btn-default" href="user.jsp">确定</button>
</form>
<hr>
<!-- Main component for a primary marketing message or call to action -->
<table id="example" class="table table-bordered table-hover">
    <thead>
    <th>序号</th>
    <th>记录编号</th>
    <th>IC卡号</th>
    <th>车主姓名</th>
    <th>车牌号码</th>
    <th>入场日期</th>
    <th>出场日期</th>
    <th>操作</th>
    </thead>
    <tbody>
    <%Object list = request.getAttribute("data");%>
    <%for(User user:new ParkingDao().getUserAll()){%>
    <tr>
        <td><%= user.getId() %></td>
        <td><%= user.getCode() %></td>
        <td><%= user.getNumber() %></td>
        <td><%= user.getName() %></td>
        <td><%= user.getCarcode() %></td>
        <td><%= user.getIndate() %></td>
        <td><%= user.getOutdate() %></td>
        <td>
                        <a class="btn btn-warning" href="update?id=<%= user.getId()%>" role="button">修改</a>
                        <a class="btn btn-danger" href="delete?id=<%= user.getId()%>" role="button">删除</a>

        </td>
    </tr>
    <%}%>
    </tbody>
</table>
</body>
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs/dt-1.13.1/datatables.min.js"></script>
<script>
    $(document).ready(function () {
        $('#example').DataTable();
    });
</script>
</html>
